import { configureStore } from '@reduxjs/toolkit';
import wsSlice from './slices/wsSlice';
import themesSlice from './themes/slices';
import timerrSlice from './timer/timerSlice';
import gameSlice from './slices/gameSlice';
import userSlice from './slices/userSlice';

export const store = configureStore({
  reducer: {
    ws: wsSlice,
    themes: themesSlice,
    timer: timerrSlice,
    game: gameSlice,
    user: userSlice,
  },
});

export type StoreT = typeof store;

// Infer the `RootState` and `AppDispatch` types from the store itself
export type RootState = ReturnType<typeof store.getState>;
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch;
